package com.zuihai.app.mvp.model;

import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.zuihai.app.mvp.contract.FindRecyclerContract;
import com.zuihai.app.mvp.model.api.service.FindService;
import com.zuihai.app.mvp.model.entity.BaseJson;
import com.zuihai.app.mvp.model.entity.FindItem;

import javax.inject.Inject;

import rx.Observable;

/**
 * Created by Administrator on 2017/5/4 0004.
 */

@FragmentScope
public class FindRecyclerModel extends BaseModel implements FindRecyclerContract.Model {
    private FindService mFindService;

    @Inject
    public FindRecyclerModel(IRepositoryManager repositoryManagern) {
        super(repositoryManagern);
        mFindService = repositoryManagern.obtainRetrofitService(FindService.class);
    }


    @Override
    public Observable<BaseJson<FindItem>> requestHomeRecommend(int pageIndex, String userId) {
        return mFindService.requestHomeRecomment(pageIndex,userId);
    }

    @Override
    public Observable<BaseJson<FindItem>> requestFindRecomment(int pageIndex, String userId) {
        return mFindService.requestFindRecomment(pageIndex,userId);
    }

    @Override
    public Observable<BaseJson<FindItem>> requestGoods(String userId, int pageIndex) {
        return mFindService.requestGoods(userId, pageIndex);
    }

    @Override
    public Observable<BaseJson<FindItem>> requestService(String userId, int pageIndex) {
        return mFindService.requestService("204",userId,pageIndex);
    }


    @Override
    public Observable<BaseJson<FindItem>> requestSecret(String userId, int pageIndex) {
        return mFindService.requestSecret(userId, pageIndex,"201");
    }

    @Override
    public Observable<BaseJson<FindItem>> requestWhither(String userId, int pageIndex) {
        return mFindService.requestWhither("206",userId, pageIndex);
    }



    @Override
    public Observable<BaseJson<FindItem>> requestMyFindSecret(String userId, String myID, int pageIndex) {
        return mFindService.myHomeFindSecret(myID,pageIndex,userId);
    }

    @Override
    public Observable<BaseJson<FindItem>> requestMyCommodity(String userId, String myID, int pageIndex) {
        return mFindService.myHomeCommodity("205",myID,pageIndex,userId);
    }
}